package test;

import java.io.BufferedWriter;
import java.io.FileWriter;

public class BufferedWriterTest {

	public static void main(String[] args) {
		BufferedWriter bw=null;
		try {
			String fileName="resources/work.txt";
			bw=new BufferedWriter(new FileWriter(fileName));
			bw.write("西游记");
			bw.flush();
			System.out.println("写入成功");
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}finally {
		}try {
			bw.close();
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}

	}

}
